-
-
Notifications
You must be signed in to change notification settings - Fork 374
feat(PdfReader): add ShowFileName parameter #7443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds a new ShowFileName toggle to the PdfReader sample, wiring it through the demo UI and backing field so the sample can demonstrate the new PdfReader parameter. Sequence diagram for ShowFileName toggle in PdfReader demosequenceDiagram
actor User
participant Browser
participant PdfReaders_component
participant PdfReader_component
User->>Browser: Click_ShowFileName_Switch
Browser->>PdfReaders_component: Update__showFileName_binding
PdfReaders_component->>PdfReaders_component: State_has_changed
PdfReaders_component->>PdfReader_component: Render_with_ShowFileName=_showFileName
PdfReader_component-->>User: Display_viewer_with_filename_shown_or_hidden
Updated class diagram for PdfReaders component and PdfReader parameterclassDiagram
class PdfReaders {
bool _enableThumbnails
bool _showDownload
bool _showToolbar
bool _showFileName
string _url
string _streamFileName
}
class PdfReader {
string Url
bool EnableThumbnails
bool ShowTwoPagesOneView
bool ShowDownload
bool ShowToolbar
bool ShowPrint
bool ShowFileName
string ViewHeight
OnGetStreamAsync OnGetStreamAsync
}
PdfReaders --> PdfReader : uses_in_Razor_markup
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7443 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 749 749
Lines 32911 32911
Branches 4573 4573
=========================================
Hits 32911 32911
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a ShowFileName parameter to the PdfReader component, allowing users to control whether the PDF filename is displayed in the reader UI. The implementation follows the existing pattern for similar boolean toggle parameters in the sample page.
Key Changes:
- Added ShowFileName boolean parameter with default value of true
- Created UI toggle control for ShowFileName parameter
- Updated BootstrapBlazor.PdfReader package from version 10.0.23 to 10.0.24
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/BootstrapBlazor.Server/Components/Samples/PdfReaders.razor.cs | Added private boolean field _showFileName initialized to true |
| src/BootstrapBlazor.Server/Components/Samples/PdfReaders.razor | Added UI toggle for ShowFileName and bound it to PdfReader component parameter |
| src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj | Updated PdfReader package version to 10.0.24 to support new ShowFileName parameter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <PdfReader Url="@_url" EnableThumbnails="_enableThumbnails" | ||
| ShowTwoPagesOneView="_showTwoPagesOneView" ShowDownload="_showDownload" | ||
| ShowToolbar="_showToolbar" ShowPrint="_showPrint" | ||
| ShowToolbar="_showToolbar" ShowPrint="_showPrint" ShowFileName="_showFileName" |
Copilot
AI
Dec 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The boolean parameters passed to the PdfReader component are missing the @ symbol. In Blazor, when passing variable values as component parameters, you need to use @ to indicate it's a C# expression rather than a string literal. Without @, these parameters are being passed as the literal strings "_enableThumbnails", "_showTwoPagesOneView", etc., instead of the actual boolean values.
All boolean parameters on lines 60-62 need to be corrected:
- EnableThumbnails should be EnableThumbnails="@_enableThumbnails"
- ShowTwoPagesOneView should be ShowTwoPagesOneView="@_showTwoPagesOneView"
- ShowDownload should be ShowDownload="@_showDownload"
- ShowToolbar should be ShowToolbar="@_showToolbar"
- ShowPrint should be ShowPrint="@_showPrint"
- ShowFileName should be ShowFileName="@_showFileName"
This is a pre-existing issue affecting all parameters except Url, but it should be fixed as part of this PR since you're already modifying this line.
Link issues
fixes #7442
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
New Features: